import {Component, OnInit} from '@angular/core';
import {COMMON_TYPE, Config, DataModel} from 'src/app/home/common/common-list/common-list.model';
import {ASYNC_URLS} from 'src/app/shared/crud/async-url.crud';

@Component({
  selector: 'app-${cfg.frontEndFileName}',
  templateUrl: './${cfg.frontEndFileName}.component.html',
  styleUrls: ['./${cfg.frontEndFileName}.component.scss']
})
export class ${cfg.name?cap_first}FindComponent implements OnInit {
  public config: Config;
  public dataModel: DataModel;

  constructor() {
    this.config = new Config({
      button: [],
      table: [
         <#list table.fields as field>
        {
          name: '${field.comment}', field: '${field.propertyName}', type: COMMON_TYPE.table.text,
          tabStyle: {width: '15%'}
        },
         </#list>
      ],
      query: [
         <#list table.fields as field>
        {
          name: '${field.comment}', field: 'checkStatus', type: COMMON_TYPE.query.text
        },
         </#list>
      ],
      displays: [],
      method: 'POST',
      paginatorShow: true,
      http: {
        data: [],
        url: ASYNC_URLS.${cfg.name}List,
        reqKey: '${cfg.name}',
        resKey: 'pageModel.rows' // 返回key
      },
      style: {}
    });
    this.dataModel = new DataModel();

  }

  ngOnInit() {
  }

}

